package com.xhwl.centiotdata.handler.eesd.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xhwl.centiotdata.handler.eesd.EesdFactory;
import com.xhwl.centiotdata.handler.eesd.EesdHandler;
import com.xhwl.centiotdata.pojo.dto.eesd.EesdConfigDTO;
import com.xhwl.centiotdata.pojo.enums.eesd.EesdMethodEnum;
import com.xhwl.centiotdata.suppliersystem.eesd.runpaq.RunpaqApiHandler;

import lombok.extern.slf4j.Slf4j;

/**
 * RUNPAQ源牌
 * @author admin
 *
 */
@Slf4j
@Service
public class RunpaqHandler extends EesdHandler {

    @Autowired
    private RunpaqApiHandler runpaqApiHandler;

    @Override
    public void afterPropertiesSet() {
        EesdFactory.register(EesdMethodEnum.RUNPAQ.getId(), this);
    }

    @Override
    public void pullRecord(EesdConfigDTO eesdConfigDTO) {
        //拉取电表和读数
    	try {
    		runpaqApiHandler.pullRecord(eesdConfigDTO);
		} catch (Exception e) {
			log.error("获取[RUNPAQ源牌]电表实时数据系统异常", e);
		}
    }

}
